<?php 
include TMPL_PATH.'public/header.phtml';
?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
        <a href='javascript:;' class="on"><em>轮播广告列表</em></a><span>|</span>
        <a href="javascript:add();">添加轮播广告</a>
    </div>
</div>
<div class="pad_10">
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th width="15" align="center">排序</th>
			<th width="25%">alt 标题</th>
			<th width="20%" align="center">pc端图片</th>
            <th width="20%" align="center">移动端图片</th>
			<th width='10%' align="center">链接</th>
			<th width="10%" align="center">状 态</th>
			<th width="15%" align="center">管理操作</th>
		</tr>
	</thead>
<tbody>
<?php 
if(isset($slideList) && $slideList):
	foreach ($slideList as $v):
?>
	<tr>
		<td align="center"><input id="listorder-<?php echo $v['id']?>" name='listorders[<?php echo $v['id']?>]' type='text' size='3' title="当光标离开输入框后修改排序" value='<?php echo $v['listorder']?>' onblur="javascript:setting_listorder(<?php echo $v['id']?>);" class='input-text-c'></td>
		<td align="center"><a href="<?php echo $v['url'];?>" title="前往链接" target="_blank"><?php echo $v['alt'];?></a> </td>
		<td align="center" width="12%"><img src="<?php echo $v['img'];?>" height="100"></td>
        <td align="center" width="12%"><img src="<?php echo $v['imgm'];?>" height="100"></td>
		<td align="center" width="10%"><?php echo $v['url'];?></td>
		<td align="center"><?php if($v['visible']==1){?><font color="red">√</font><?php }else{?><font color="blue">×</font><?php }?></td>
		<td align="center" width="12%"><a href="javascript:edit(<?php echo $v['id'];?>)" title="修改">修改</a> |  <a href='<?php echo U('adv/slide_delete', 'sid='. $v['id']);?>'	onClick="return confirm('确认要删除 『 <?php echo $v['alt'];?> 』 吗？')">删除</a> 
		</td>
	</tr>
<?php 
	endforeach;
endif;
?>
	</tbody>
</table>
</div>
</div>
</body>
<script type="text/javascript">
<!--
function setting_listorder(id){
	var lisobj = $('#listorder-'+id);
	listorder = parseInt(lisobj.val());
	if(isNaN(listorder)){
		alert('排序只能设置为整数.');return;
	}
	$.get('<?php echo U('adv/public_slide_listorder_ajax');?>&sid='+id+'&listorder='+listorder,function(data){
		if(data==1){lisobj.val(listorder)}
	});
}
function add(){
	window.top.art.dialog({id:'add',iframe:'<?php echo U('adv/slide_add')?>', title:'添加轮播广告', width:'700', height:'450'}, function(){var d = window.top.art.dialog({id:'add'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'add'}).close()});void(0);
}
function edit(id) {
	window.top.art.dialog({id:'edit'}).close();
	window.top.art.dialog({title:'编辑轮播广告',id:'edit',iframe:'<?php echo U('adv/slide_edit');?>&sid='+id,width:'700',height:'450'}, function(){var d = window.top.art.dialog({id:'edit'}).data.iframe;var form = d.document.getElementById('dosubmit');form.click();return false;}, function(){window.top.art.dialog({id:'edit'}).close()});
}
//-->
</script>
</html>